#include <stdio.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string>
#include <gsl/gsl_math.h>

#include "IOParams.h"
#include "Gas.h"


using namespace std;

int main(int argc, char **argv){

  IOParams io(argc, argv);
  Gas g_old(io.N);
  Gas g_new(io.N);

  // Initiate angles and velocities.
	g_old.initCoord();
	g_old.initVeloc();  
	
  /**** ----------- Begin simulation   ----------- ****/
  // 1. Calculate ___force_old___.
  
	g_old.calculateVec_m();	  			//--  1.1 Calculate m_old.
  g_old.calculateVec_M();					//--  1.2 Calculate M_old.  
  g_old.calculateForce(io.eps);		//--  1.3 Calculate force_old with M_old
  
  // 2. Calculate ___theta_new___
  g_new.updateCoord(&g_old, io.dt, io.dt2);
     
  // 3. Calculate ___force_new___
	g_new.calculateVec_m();					//--  3.1 Calculate m_new
	g_new.calculateVec_M();					//--  3.2 Calculate M_new
	g_new.calculateForce(io.eps);		//--  3.3 Calculate force_new with M_new
    
  // 4. Calculate ___omega_new___
  g_new.updateVeloc(&g_old, io.dt);

  /****----------- End simulation   ----------- ****/  
}

